package com.ivo.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "PDM_D_TMPL_ATTR")
public class TemplateAttribute extends Model
{
	private static final long serialVersionUID = 5491887576374209707L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "TMPL_ATTR_ID")
	private Long attributeId;
	
	@Column(name = "TMPL_ATTR_NAME", length = 100)
	private String attributeName;
	
	@Column(name = "ATTR_LABEL_TEXT", length = 100)
	private String attributeLabelText;
	
	@Column(name = "DEFT_VALUE", length = 100)
	private String defaultValue;
	
	@Column(name = "LENGTH")
	private int length;
	
	@Column(name = "FORMAT")
	private String format;
	
	@Column(name = "DATA_SOURCE", length = 512)
	private String dataSource;
	
	@Column(name = "SEPERATOR_FLAG")
	private short seperatorFlag;
	
	@Column(name = "DECIMAL_DIGITS")
	private int decimalDigits;
	
	@Column(name = "COL_SPAN")
	private int colSpan;
	
	@Column(name = "TABLE_INDEX")
	private int tableIndex;
	
	@Column(name = "ROW_INDEX")
	private int rowIndex;
	
	@Column(name = "COL_INDEX")
	private int colIndex;
	
	@Column(name = "IS_ROW")
	private boolean isRow;
	
	@Column(name = "IS_CELL")
	private boolean isCell;
	
	@Column(name = "SORT_ORDER")
	private int sortOrder;
	
	@OneToOne(cascade = { CascadeType.MERGE })
	@JoinColumn(name = "TMPL_FK")
	private Template template;
	
	@OneToOne(cascade = { CascadeType.MERGE })
	@JoinColumn(name = "DATA_TYPE_FK")
	private DataType dataType;

	public Long getAttributeId()
	{
		return attributeId;
	}

	public void setAttributeId(Long attributeId)
	{
		this.attributeId = attributeId;
	}

	public String getAttributeName()
	{
		return attributeName;
	}

	public void setAttributeName(String attributeName)
	{
		this.attributeName = attributeName;
	}

	public String getAttributeLabelText()
	{
		return attributeLabelText;
	}

	public void setAttributeLabelText(String attributeLabelText)
	{
		this.attributeLabelText = attributeLabelText;
	}

	public String getDefaultValue()
	{
		return defaultValue;
	}

	public void setDefaultValue(String defaultValue)
	{
		this.defaultValue = defaultValue;
	}

	public int getLength()
	{
		return length;
	}

	public void setLength(int length)
	{
		this.length = length;
	}

	public String getFormat()
	{
		return format;
	}

	public void setFormat(String format)
	{
		this.format = format;
	}

	public String getDataSource()
	{
		return dataSource;
	}

	public void setDataSource(String dataSource)
	{
		this.dataSource = dataSource;
	}

	public short getSeperatorFlag()
	{
		return seperatorFlag;
	}

	public void setSeperatorFlag(short seperatorFlag)
	{
		this.seperatorFlag = seperatorFlag;
	}

	public int getDecimalDigits()
	{
		return decimalDigits;
	}

	public void setDecimalDigits(int decimalDigits)
	{
		this.decimalDigits = decimalDigits;
	}

	public int getColSpan()
	{
		return colSpan;
	}

	public void setColSpan(int colSpan)
	{
		this.colSpan = colSpan;
	}

	public int getTableIndex()
	{
		return tableIndex;
	}

	public void setTableIndex(int tableIndex)
	{
		this.tableIndex = tableIndex;
	}

	public int getRowIndex()
	{
		return rowIndex;
	}

	public void setRowIndex(int rowIndex)
	{
		this.rowIndex = rowIndex;
	}

	public int getColIndex()
	{
		return colIndex;
	}

	public void setColIndex(int colIndex)
	{
		this.colIndex = colIndex;
	}

	public int getSortOrder()
	{
		return sortOrder;
	}

	public void setSortOrder(int sortOrder)
	{
		this.sortOrder = sortOrder;
	}

	public Template getTemplate()
	{
		return template;
	}

	public void setTemplate(Template template)
	{
		this.template = template;
	}

	public DataType getDataType()
	{
		return dataType;
	}

	public void setDataType(DataType dataType)
	{
		this.dataType = dataType;
	}

}
